<!DOCTYPE html>  
<html lang="en">  
<head>  
    <meta charset="UTF-8">  
    <meta name="viewport" content="width=device-width, initial-scale=1.0">  
    <title>青岛旅游_搜索</title>
    <link rel="stylesheet" href="nav_style.css">
    <style>
        .search{
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            height: 100px;
            width: 100%;
            /* 以下是为了让输入框和按钮居中 */
            text-align: center;
        }
        input,button{
            font-size: 30px;
            /* 以下是为了让输入框和按钮居中 */
            display: inline-block;
            vertical-align: middle;
            opacity: 90%;
        }
        input{
            margin-right: 20px;
             /* 添加一些空间 */
        }
        button{
            color: #011a90;
        }
        p{
            opacity: 50%;
        }
    </style>
</head>  

<body> 
<script src="nav.js"></script>

<div class="search">
    <input type="text" id="searchInput">  
    <button onclick="searchBing()">搜索</button>  
    <br>
    <p>search by bing</p>
</div>

<script>  
    function searchBing() {  
        var searchTerm = document.getElementById('searchInput').value;  
        if (searchTerm) {  
            window.location.href='https://www.bing.com/search?q='+encodeURIComponent(searchTerm);  
        }  
    }  
</script>  
</body>  
</html>
